const mongoose = require('mongoose');
/* 编号  expense_id
会员id   member_id
消费项目 detail
时间  date
工号  employee_id
折扣  discount
应收  yingshou
实收  shishou */
const expenseSchema = new mongoose.Schema({
    expense_id: {
        type: String,
        unique: true,
        required: true
    },
    member_id: {
        type: String,
        required: true
    },
    detail: {
        type: String
    },
    date: {
        type: Date,
        required: true,
        default: Date.now()
    },
    employee_id: {
        type: String,
        unique: true,
        required: true
    },
    discount: {
        type: Number,
        required: true
    },
    yingshou: {
        type: Number,
        required: true
    },
    shishou: {
        type: Number,
        required: true
    }

})
module.exports = mongoose.model('expenses', expenseSchema);